<template>
	<view>
		<view class="box" @click="clickBox">
		<view class="img">
			<slot name="img">
			<image class="showimg" src="/static/navImg/1.jpg" mode="aspectFill"></image>
			</slot>
		</view>
		<slot name="text">
		<view class="text">聊天室</view>
		</slot>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			path: {
				type: String,
				default: ''
			}
		},
		name:"myNav",
		
		data() {
			return {
				
			};
		},
		methods: {
			clickBox(){
				// console.log(this.path)
				if (this.path){
					uni.navigateTo({
						url:this.path
					})
				}
				else{
					uni.showToast({
						title: '模块开发中...',
						duration: 2000,
						icon:'error'
					});
				}
				
			}
		}
	}
</script>

<style lang="scss">
	.box{
		width: 320rpx;
		height: 360rpx;
		display: flex;
		justify-content: center;
		flex-wrap: wrap;
		
		.img{
			margin: 10rpx 10rpx;
		}
		.text{
			text-align: center;
			color: #000000;
		}
	}
	.showimg{
		width: 280rpx;
		height: 280rpx;
	}
	
</style>